package com.bjpowernode.controller;

import com.bjpowernode.entity.TActivityDO;
import com.bjpowernode.entity.TProductDO;
import com.bjpowernode.result.R;
import com.bjpowernode.service.ProductService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ProductController {

    @Resource
    private ProductService productService;

    @GetMapping(value = "/api/product/onsale")
    public R ongoingActivity() {
        List<TProductDO> tProductDOList = productService.getOnSaleProduct();
        return R.OK(tProductDOList);
    }
}
